﻿// <copyright file="NewsItem.cs" company="Microsoft Corporation">
// Copyright (c) 2009 Microsoft Corporation All Rights Reserved
// </copyright>
// <author>Michael S. Scherotter</author>
// <email>mischero@microsoft.com</email>
// <date>2009-04-12</date>
// <summary>News Item class definition</summary>

namespace NYTimes.Data
{
    using System;
    using System.Collections.Generic;

    /// <summary>
    /// News Item returned from NewsWire API
    /// </summary>
    /// <seealso cref="NYTimes.Newswire"/>
    public class NewsItem
    {
        /// <summary>
        /// Gets or sets the Url of the article
        /// </summary>
        public Uri Url { get; set; }

        /// <summary>
        /// Gets or sets the article section
        /// </summary>
        public string Section { get; set; }

        /// <summary>
        /// Gets or sets the headline
        /// </summary>
        public string Headline { get; set; }

        /// <summary>
        /// Gets or sets the summary
        /// </summary>
        public string Summary { get; set; }

        /// <summary>
        /// Gets or sets the byline
        /// </summary>
        public string Byline { get; set; }

        /// <summary>
        /// Gets or sets the platform
        /// </summary>
        public string Platform { get; set; }

        /// <summary>
        /// Gets or sets the article source
        /// </summary>
        public string Source { get; set; }

        /// <summary>
        /// Gets or sets the date/time updated
        /// </summary>
        public DateTime Updated { get; set; }

        /// <summary>
        /// Gets or sets the date/time created
        /// </summary>
        public DateTime Created { get; set; }

        /// <summary>
        /// Gets or sets the published date
        /// </summary>
        public DateTime PubDate { get; set; }

        /// <summary>
        /// Gets or sets the subtype
        /// </summary>
        /// <remarks>valid values are News,Editorial, Obituary (Obit), List</remarks>
        public string Subtype { get; set; }

        /// <summary>
        /// Gets or sets the Article Kicker
        /// </summary>
        public string Kicker { get; set; }

        /// <summary>
        /// Gets or sets the sub-headline
        /// </summary>
        public string SubHeadline { get; set; }

        /// <summary>
        /// Gets or sets the Blog name
        /// </summary>
        public string BlogName { get; set; }

        /// <summary>
        /// Gets or sets the locations mentioned in the article
        /// </summary>
        public IEnumerable<string> Locations { get; set; }

        /// <summary>
        /// Gets or sets the organizations mentioned in the article
        /// </summary>
        public IEnumerable<string> Organizations { get; set; }

        /// <summary>
        /// Gets or sets the people mentioned in the article
        /// </summary>
        public IEnumerable<string> People { get; set; }

        /// <summary>
        /// Gets or sets the terms mentioned in the article
        /// </summary>
        public IEnumerable<string> Terms { get; set; }

        /// <summary>
        /// Gets or sets the related Urls for a news item as an enumerable of 
        /// <see cref="NYTimes.Data.Link"/> objects
        /// </summary>
        public IEnumerable<Link> RelatedUrls { get; set; }

        /// <summary>
        /// Gets or sets the media for a news item as an enumerable collection of 
        /// <see cref="NYTimes.Data.NewsItemMedia"/> objects.
        /// </summary>
        public IEnumerable<NewsItemMedia> Media { get; set; }

        /// <summary>
        /// Gets or sets the type: Article or Blog
        /// </summary>
        public string ItemType { get; set; }

        /// <summary>
        /// Gets the properties and values listed
        /// </summary>
        /// <returns>a string with the property names and values</returns>
        public override string ToString()
        {
            return Synergist.Utility.GetProperties(this);
        }
    }
}
